package com.yonyou.pmclouds.lock.service.impl;

import com.yonyou.pmclouds.basecom.entity.SuperVO;
import com.yonyou.pmclouds.basecom.exception.BusinessRuntimeException;
import com.yonyou.pmclouds.basecom.multilanguage.ResUtil;
import com.yonyou.pmclouds.lock.mapper.LockMapper;
import com.yonyou.pmclouds.lock.service.itf.LockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("LockService")
public class LockServiceImpl implements LockService{

private LockMapper lockMapper;
	
	public LockMapper getLockMapper() {
		return lockMapper;
	}
	
	@Autowired
	public void setLockMapper(LockMapper lockMapper) {
		this.lockMapper = lockMapper;
	}
	
	@Override
	public void checkFlag(SuperVO vo) {
		int count = this.lockMapper.checkChangeFlag(vo);
		
		if(count!=1)
		{
			throw new BusinessRuntimeException(ResUtil.getInstance().getResString("lockerrormsg"));
		}
	}

}
